{% schema %}
{
  "name": "Swiper Verge",
  "settings": [],
    "blocks": [
    {
      "type": "swiper_item",
      "name": "Swiper Item",
      "settings": [
        {
          "type": "url",
          "id": "image",
          "label": "Image",
        },
        {
          "type": "text",
          "id": "description",
          "label": "Description",
          "default": "Your personal theater. Stunning visuals, immersive sound—anywhere you are."
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Default",
      "category": "Custom"
    }
  ]
}
{% endschema %}

{%- style -%}
    .box-{{ section.id }} { 
      padding-top: 50px;
      padding-bottom: 88px;
    }
       .box-{{ section.id }} .swiper {
          width: 100%; 
          overflow: visible;
         margin-left: -24px;
        }

       .box-{{ section.id }} .swiper-slide {
          text-align: center;
          font-size: 18px;
          display: flex;
          justify-content: center;
          align-items: center;
        }

       .box-{{ section.id }} .swiper-slide {
          width: calc(100% - 48px);
         display: flex;
         flex-direction: column;
        marign-left: -24px;
        }

       .box-{{ section.id }} .swiper-pagination-{{ section.id }} {
          position: absolute;
          top: auto !important;
          bottom: 1.5rem !important;
          left: 24px !important;
          width: calc(100% - 48px) !important;
         z-index: 1;
        }
      .box-{{ section.id }} .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
  background: #000;
      }
    .box-{{ section.id }} .swiper-pagination-progressbar {
      background: rgba(230, 230, 230, 0.8);
      border-radius: 4px;
       
    }
    .box-title-{{ section.id }} {
      width: 188px;
      font-family: HarmonyOS Sans;
      font-size: 36px;
      font-weight: bold;
      line-height: 120%;
      text-align: center;
      letter-spacing: -1.44px;
      color: #FFFFFF;
    }
  .swiper-item-title-{{ section.id }} {
    width: 100%;
    font-family: HarmonyOS Sans;
    font-size: 16px;
    font-weight: bold;
    line-height: 100%;
    letter-spacing: -1px;
    color: #FFFFFF;
    text-align: left;
  }
  .swiper-item-card-{{ section.id }} {
    width: 100%;
    min-height: 379px;
    border-radius: 20px;
    background: #F7F7F7;
    overflow: hidden;
  }
  .card-{{ section.id }} {
    display: none;
  }
    .card-item-{{ section.id }} {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: #F7F7F7;
  }
  .card-item-img-top-left {
    width: 40px;
    height: auto;
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
  }
  .card-item-text {
    font-family: HarmonyOS Sans;
font-size: 18px;
font-weight: bold;
line-height: 120%;
display: flex;
align-items: flex-end;
letter-spacing: -0.56px;
text-align: left;
color: #86868B;
  }
  .card-item-logo {
    height: 50px;
  }
  .card-item-logo-{{ section.id }} {
    padding-top: 60px;
    height: 110px;
    text-align: left;
  }
{%- endstyle -%}
  {% assign img_top_left = "https://cdn.shopify.com/s/files/1/0628/5636/4211/files/icon_20240831.png?v=1725090316" %}
<div class="bg-white position-relative overflow-hidden">
<div class="box-{{ section.id }} container">
  <div class="swiper mySwiper-{{ section.id }} pb-7">
    <div class="swiper-wrapper" style="transition-duration: 0ms; transition-delay: 0ms; transform: translate3d(34.203px, 0px, 0px);">
      {% for block in section.blocks %}
      <div class="swiper-slide" style="margin-right: 24px;">
        <div class="swiper-item-card-{{ section.id }}">
           <div class="card-item-{{ section.id }} d-flex flex-column p-4">
              <div class="card-item-logo-{{ section.id }} mb-4">
                  <img class="card-item-logo" src="{{ block.settings.image }}" />
                </div>
                <div>
                  <div class="card-item-text">{{ block.settings.description }}</div>
                </div>
              <img class="card-item-img-top-left" src="{{ img_top_left }}" />
            </div>
        </div>
      </div>
      {% endfor %}
    </div>
    <div class="swiper-pagination-{{ section.id }}"></div>
  </div>

  {% assign sliced_list1 = section.blocks | slice: 0,2 %}
  {% assign sliced_list2 = section.blocks | slice: 2,2 %}
  {% assign sliced_list3 = section.blocks | slice: 4,2 %}
  
  <div class="card-{{ section.id }} position-relative">
    <div class="top-0 start-0 bottom-0 end-0">
        <div class="row gx-4 gy-0 h-100 justify-content-between">
        <div class="col col-4 row gy-6">
          <div class="row gy-4 gx-0 flex-column">
            {% for block in sliced_list1 %}
            <div class="card-item-{{ section.id }} anim d-flex flex-column">
              <div class="top-0 bottom-0 start-0 end-0 p-4">
                <div class="pt-6 mb-4 text-center">
                  <img class="card-item-logo" src="{{ block.settings.image }}" />
                </div>
                <div>
                  <div class="card-item-text">{{ block.settings.description }}</div>
                </div>
              </div>
              <img class="card-item-img-top-left" src="{{ img_top_left }}" />
            </div>
            {% endfor %}
          </div>
        </div>
        <div class="col col-4">
          <div class="row gy-4 gx-0 flex-column">
            {% for block in sliced_list2 %}
            <div class="card-item-{{ section.id }} anim d-flex flex-column">
              <div class="top-0 bottom-0 start-0 end-0 p-4">
                <div class="pt-6 mb-4 text-center">
                  <img class="card-item-logo" src="{{ block.settings.image }}" />
                </div>
                <div>
                  <div class="card-item-text">{{ block.settings.description }}</div>
                </div>
              </div>
              <img class="card-item-img-top-left" src="{{ img_top_left }}" />
            </div>
            {% endfor %}
          </div>
        </div>
         <div class="col col-4 row gy-6">
          <div class="row gy-4 gx-0 flex-column">
            {% for block in sliced_list3 %}
           <div class="card-item-{{ section.id }} anim d-flex flex-column">
              <div class="top-0 bottom-0 start-0 end-0 p-4">
                <div class="pt-6 mb-4 text-center">
                  <img class="card-item-logo" src="{{ block.settings.image }}" />
                </div>
                <div>
                  <div class="card-item-text">{{ block.settings.description }}</div>
                </div>
              </div>
              <img class="card-item-img-top-left" src="{{ img_top_left }}" />
            </div>
            {% endfor %}
          </div>
        </div>
      </div>
    </div>
  </div>

  
</div>
</div>
<script>
 document.addEventListener('DOMContentLoaded', function () {
      new Swiper(".mySwiper-{{ section.id }}", {
    slidesPerView: "auto",
    centeredSlides: true,
    spaceBetween: 24,
    pagination: {
      el: ".swiper-pagination-{{ section.id }}",
      type: "progressbar",
    },
  });
  });
</script>


<style>
@media (min-width: 1280px) {
  .mySwiper-{{ section.id }} {
    display: none;
  }
  .card-{{ section.id }} {
    display: block;
  }
  .card-item-{{ section.id }} {
    position: relative;
    width: 423px;
    height: auto;
    border-radius: 20px;
    background: #F7F7F7;
  }
  .card-item-img-top-left {
    width: 40px;
    height: auto;
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
  }
  .card-item-text {
    font-family: HarmonyOS Sans;
font-size: 16px;
font-weight: bold;
line-height: 120%;
display: flex;
align-items: flex-end;
letter-spacing: -0.56px;

color: #86868B;
  }
  .card-item-logo {
    height: 50px;
  }
}
@media (min-width: 1440px) { 
  .card-{{ section.id }} {
    display: block;
  }
  .card-item-{{ section.id }} {
   }
  .card-item-text {
    font-size: 18px;
  }
} 
</style>
